package org.lzh.dao;

import org.apache.ibatis.annotations.Update;
import org.lzh.pojo.TestPaper;

import java.util.List;

public interface TestPaperDao {
    //多个参数一定要指定对应的属性，不然Mybatis识别不了

    //-------------------------------------------------新增操作--------------------------------------
    //新建试卷
    public int insertTestPaper(TestPaper testPaper);



    //-------------------------------------------------删除操作-------------------------------------
    //根据id删除该试卷
    public int deleteById(Integer id);

    //-------------------------------------------------查找操作-------------------------------------

    //根据id查找试卷
    public TestPaper findById(String id);//去掉@Param("id")行不行


    //查询所有试卷 分询（通过数组）
    public List<TestPaper> findAllTestPaper();

    //动态sql查询
    public List<TestPaper> findByDynamic(TestPaper testPaper);

    //-------------------------------------------------更新操作-------------------------------------
    //根据id更新用户
    @Update("update test_paper set name=#{name},remark=#{remark} where id=#{id}")
    public int updateById(TestPaper testPaper);
}
